import Vue from 'vue'
import App from './App.vue'


import TypeNav from '@/components/TypeNav'// 三级联动组件
Vue.component('TypeNav', TypeNav)
import Carousel from '@/components/Carousel'//轮播图
Vue.component('Carousel', Carousel)
import Pagination from '@/components/Pagination'
Vue.component('Pagination', Pagination)

import { Button, MessageBox } from 'element-ui';
Vue.prototype.$alert = MessageBox.alert
Vue.prototype.$msgbox = MessageBox
import router from './router'// 引入路由
import store from '@/store' //引入仓库
Vue.config.productionTip = false
//测试
import { reqCategoryList } from '@/api'
reqCategoryList();

// 引入api文件夹中全部请求函数
import * as API from '@/api'

// 引入mockServe.js
import '@/mock/mockServe'
// 引入swiper样式
// import 'swiper/css/swiper.css'


import pic from '@/assets/logo.png'
// 引入懒加载
import VueLazyload from 'vue-lazyload'
Vue.use(VueLazyload, {
  // 懒加载默认的图片
  loading: pic
})

// 引入自定义插件
import myPlugins from './plugins/myPlugins'
Vue.use(myPlugins, {
  name: 'lazy'
})

// 引入表单校验插件
import "@/plugins/validate"

new Vue({
  render: h => h(App),
  beforeCreate() {
    Vue.prototype.$bus = this
    Vue.prototype.$API = API  //
  },
  router,//注册路由器，KV一致，简写形式，组件实例增加$route、$router
  store,//注册store仓库,件实例增加$store
}).$mount('#app')
